package com.ruoyi.merchant.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.DataMatchOrderItemMapper;
import com.ruoyi.db.domain.DataMatchOrderItem;
import com.ruoyi.merchant.service.IDataMatchOrderItemService;

/**
 * 商户匹配订单子项信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-26
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class DataMatchOrderItemServiceImpl implements IDataMatchOrderItemService 
{
    @Autowired
    private DataMatchOrderItemMapper dataMatchOrderItemMapper;

    /**
     * 查询商户匹配订单子项信息
     * 
     * @param id 商户匹配订单子项信息主键
     * @return 商户匹配订单子项信息
     */
    @Override
    public DataMatchOrderItem selectDataMatchOrderItemById(Long id)
    {
        return dataMatchOrderItemMapper.selectDataMatchOrderItemById(id);
    }

    /**
     * 查询商户匹配订单子项信息列表
     * 
     * @param dataMatchOrderItem 商户匹配订单子项信息
     * @return 商户匹配订单子项信息
     */
    @Override
    public List<DataMatchOrderItem> selectDataMatchOrderItemList(DataMatchOrderItem dataMatchOrderItem)
    {
        return dataMatchOrderItemMapper.selectDataMatchOrderItemList(dataMatchOrderItem);
    }

    /**
     * 查询商户匹配订单子项信息列表
     *
     * @param dataMatchOrderItem 商户匹配订单子项信息
     * @return 商户匹配订单子项信息
     */
    @Override
    public List<Map<String, Object>> selectDataMatchOrderItemMapList(DataMatchOrderItem dataMatchOrderItem)
    {
        return dataMatchOrderItemMapper.selectDataMatchOrderItemMapList(dataMatchOrderItem);
    }

    /**
     * 新增商户匹配订单子项信息
     * 
     * @param dataMatchOrderItem 商户匹配订单子项信息
     * @return 结果
     */
    @Override
    public int insertDataMatchOrderItem(DataMatchOrderItem dataMatchOrderItem)
    {
        dataMatchOrderItem.setCreateTime(DateUtils.getNowDate());
        return dataMatchOrderItemMapper.insertDataMatchOrderItem(dataMatchOrderItem);
    }

    /**
     * 修改商户匹配订单子项信息
     * 
     * @param dataMatchOrderItem 商户匹配订单子项信息
     * @return 结果
     */
    @Override
    public int updateDataMatchOrderItem(DataMatchOrderItem dataMatchOrderItem)
    {
        dataMatchOrderItem.setUpdateTime(DateUtils.getNowDate());
        return dataMatchOrderItemMapper.updateDataMatchOrderItem(dataMatchOrderItem);
    }

    /**
     * 批量删除商户匹配订单子项信息
     * 
     * @param ids 需要删除的商户匹配订单子项信息主键
     * @return 结果
     */
    @Override
    public int deleteDataMatchOrderItemByIds(Long[] ids)
    {
        return dataMatchOrderItemMapper.deleteDataMatchOrderItemByIds(ids);
    }

    /**
     * 删除商户匹配订单子项信息信息
     * 
     * @param id 商户匹配订单子项信息主键
     * @return 结果
     */
    @Override
    public int deleteDataMatchOrderItemById(Long id)
    {
        return dataMatchOrderItemMapper.deleteDataMatchOrderItemById(id);
    }
}
